package com.abc.controller;

import com.abc.bean.Stock;
import com.abc.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*
 * @Author yaxiongliu
 **/
@RestController
public class StockController {
    @Autowired
    private StockService stockService;

    @RequestMapping("/stock/add")
    public boolean addStockHandle(@RequestBody Stock stock) {
        stockService.addStock(stock);

        int i=1/0;
        //手动异常
       // throw new RuntimeException("bug is coming~");
        return true;
    }
}
